<template>
  <div>   
    <h1>员工财务报表</h1>
    <div id="main" style="width: 600px; height: 600px"></div>
  </div>
</template>

<script>
export default {
    // name: "c1",
  data() {
    return {
        AccountEchartsList:[]
    };
  },
  mounted() {    
    this.AccountEcharts1();
    
  },
  methods: {
    AccountEcharts1(){
        this.$axios.get("company/quereyEcharts1")
        .then(res=>{
             
            this.AccountEchartsList = res.data.data.AccountEchartsList;
            this.getChar();
             
        })
    },
    getChar() {
      // 基于准备好的dom，初始化echarts实例
      var myChart = this.$echarts.init(document.getElementById("main"));
      // 指定图表的配置项和数据
        var option = {
  title: {
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: this.AccountEchartsList,
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    },
    
  ]
};
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    },
  },
};
</script>